<?php
/**
* Page.class.php
*
* Part of the Factory Method. Page declares the factory method, which returns an object of type PageModule. 
* Creator may also define a default implementation of the factory method that returns a default ConcreteProduct object.
* may call the factory method to create a PageModule object.
*
* @author     Blazej Zieba <b@zieba.info>
* @copyright  2007 konekto.com
* @version    CVS: $Id:$
*/

// {{{ Page
class Page 
{
    // {{{ Class attributes 

    /**
    * List of modules 
    * @var list 
    * @access private  
    */

    var $_pageModuleList = array();

    // }}} Class attributes 

    // {{{ Class operations
    
    // {{{ C'tor

    /** 
    * C'tor
    * Create page modules
    *   
    */

    function Page()
    {
        $this->createPageModule();
    }

    // }}}

    // {{{ createPageModules

    /**    
    * Factory method
    * Have to implemented in concrete Page implementation  
    */

    function createPageModule()
    {
    }

    // }}}

    // {{{ getPageModuleList()

    /**
    * Returns array with Page Modules
    * @return array
    */

    function getPageModuleList()
    {
        return $this->_pageModuleList; 
    }

    // }}}

    // }}} Class operations 

    // {{{ getPageModuleList()

    /**
    * Returns page content
    * @return string
    */

    function getContent()
    {

        $content = NULL;

        foreach ( $this->getPageModuleList() as $module )
        {   
            $content .= $module->getContent();
        }   
        
        return $content;
    }

    // }}}

    // }}} Class operations 
}

// }}}

?>
